POV-Ray : Newsgroups : povray.advanced-users : Max-value with function int() : Re: Max-value with function int() Server Time
29 Jul 2024 00:34:26 EDT (-0400)
  Re: Max-value with function int()  
From: Warp
Date: 14 May 2003 08:45:04
Message: <3ec23a4f@news.povray.org>
Christopher James Huff <cja### [at] earthlinknet> wrote:
> The standard C rint() function may be a better way to 
> implement this.

  Rounding would change its behaviour, which might not be good (eg. int(0.6)
would now give 1 instead of 0).

  If the different behaviour of floor() with regard to negative values is
a problem, then the solution is easy: x<0 ? -floor(-x) : floor(x)

-- 
plane{-x+y,-1pigment{bozo color_map{[0rgb x][1rgb x+y]}turbulence 1}}
sphere{0,2pigment{rgbt 1}interior{media{emission 1density{spherical
density_map{[0rgb 0][.5rgb<1,.5>][1rgb 1]}turbulence.9}}}scale
<1,1,3>hollow}text{ttf"timrom""Warp".1,0translate<-1,-.1,2>}//  - Warp -


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.